[Unit]
Description=Prometheus Node Exporter
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull {{ node_exporter_container }}
ExecStart=/usr/bin/docker run --rm --net="host" --pid="host" --name %n -v {{ node_exporter_prom_dir }}:/run/prometheus {{ node_exporter_container }} --collector.textfile.directory="{{ node_exporter_prom_dir }}"

[Install]
WantedBy=multi-user.target
